import { ref, computed } from 'vue'
import { defineStore } from 'pinia'

export const useAuthorizationStore = defineStore('authorization', () => {
    // 定义token
    const authorization = ref('');

    // 重置倒计时的 action
    const setAuthorization = (val: string) => {
        console.log(val);
        
        authorization.value = val;
    };

    // 清除
    const clearAuthorization = () => {
        authorization.value = '';
    }

    return { authorization, setAuthorization, clearAuthorization };
}, {
    persist: {
        storage: localStorage,
    }
})